home *** CD-ROM | disk | FTP | other *** search
- this.init = function()
- {
- var _loc1_ = this;
- _loc1_.pState = 0;
- _loc1_.pPumpNum = _loc1_._name.substr(4,1);
- if(_loc1_.pPumpNum <= 3)
- {
- _loc1_.pPumpType = "down";
- }
- else
- {
- _loc1_.pPumpType = "up";
- }
- };
- this.gameover = function()
- {
- this.readOut_mc.stopReadout();
- this.gotoAndPlay("closed");
- };
- this.openPump = function()
- {
- this.gotoAndPlay("open");
- };
- this.slowPump = function()
- {
- this.gotoAndPlay("finishing_" + this.pPumpType);
- };
- this.startPump = function()
- {
- var _loc1_ = this;
- _loc1_.pState = 3;
- _loc1_._parent.pForeCourt.pumpStarted(_loc1_.pPumpNum);
- _loc1_.gotoAndPlay("fuelling_" + _loc1_.pPumpType);
- };
- this.stopPump = function()
- {
- var _loc1_ = this;
- _loc1_.readOut_mc.stopReadout();
- _loc1_._parent.pForeCourt.pumpDone(_loc1_.pPumpNum);
- _loc1_._parent.pForeCourt.leavingSpace(_loc1_.pPumpNum - 1);
- if(_loc1_.pState == 3)
- {
- _loc1_.gotoAndPlay("done");
- _loc1_._parent.pStelios.showWin();
- }
- else
- {
- _loc1_.gotoAndPlay("sand");
- _loc1_._parent["fuel" + _loc1_.pPumpNum + "_mc"].gotoAndPlay("sand_" + _loc1_.pPumpType);
- if(_loc1_._parent.pLives > 1)
- {
- _loc1_._parent.pLives -= 1;
- _loc1_._parent.lives_mc.reduceBy(22);
- _loc1_._parent.pStelios.showLose();
- }
- else
- {
- _loc1_._parent.gameOver();
- _loc1_._parent.pStelios.flyAway();
- }
- }
- _loc1_.pState = 1;
- };
- this.checkPumpReadout = function()
- {
- var _loc1_ = this;
- if(_loc1_.pState == 3)
- {
- _loc1_.stopPump();
- }
- else if(_loc1_.pState == 4)
- {
- _loc1_.pState = 5;
- _loc1_._parent["fuel" + _loc1_.pPumpNum + "_mc"].gotoAndPlay("petrol_" + _loc1_.pPumpType);
- _loc1_._parent.pForeCourt.pumpDone(_loc1_.pPumpNum);
- }
- };
- this.checkPumpCar = function()
- {
- var _loc1_ = this;
- if(_loc1_.pState == 0)
- {
- _loc1_.pState = 2;
- _loc1_.gotoAndPlay("waiting");
- }
- else if(_loc1_.pState == 1)
- {
- _loc1_.startPump();
- }
- };
- this.checkPumpStelios = function()
- {
- var _loc1_ = this;
- if(_loc1_.pState == 0)
- {
- _loc1_.pState = 1;
- }
- else if(_loc1_.pState == 2)
- {
- _loc1_.startPump();
- }
- else if(_loc1_.pState == 4)
- {
- _loc1_.pState = 3;
- }
- else if(_loc1_.pState == 5)
- {
- _loc1_.stopPump();
- }
- };
- this.angryCar = function()
- {
- this.gotoAndPlay("angry");
- };
- this.leavingPump = function()
- {
- var _loc1_ = this;
- if(_loc1_.pState == 2)
- {
- _loc1_.gotoAndPlay("lost_money");
- _loc1_.pState = 0;
- }
- else if(_loc1_.pState == 5)
- {
- _loc1_.gotoAndPlay("overfill_" + _loc1_.pPumpType);
- }
- };
- this.leftPump = function()
- {
- var _loc1_ = this;
- if(_loc1_.pState == 1)
- {
- _loc1_.pState = 0;
- }
- else if(_loc1_.pState == 3)
- {
- _loc1_.pState = 4;
- }
- };
- this.init();
-